public class ErWeiArr {
    public static void main(String[] args) {
//        int[][] arr = {
//                {1,2,3},
//                {4,5,6,7}
//        };
        int[][] a = new int[2][4];
        int[] a1 = {1,2,3,4};
        a[0] = a1;
        xunhuanerwei(a);
//        xunhuanerwei(arr);
//      int r =   getErWeiSum(arr);
//        System.out.println(r);
//        erwei1();
    }
    public static void erwei1(){
        int[][] arr = {
                {1,2,3},
                {4,5,6,7}
        };
        System.out.println(arr[0][2]);
    }
    public static void xunhuanerwei(int[][] arr){
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                System.out.println(arr[i][j]);
            }
        }
    }
    public static int getErWeiSum(int[][] arr){
        int res = 0;
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                System.out.println(arr[i][j]);
                res+=arr[i][j];
            }
        }
        return res;
    }
}
